//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __CBYTEARRAYOUTPUTSTREAM_H__
#define __CBYTEARRAYOUTPUTSTREAM_H__

#include "_CByteArrayOutputStream.h"

CarClass(CByteArrayOutputStream)
{
public:
    CARAPI Close();

    CARAPI Flush();

    CARAPI Write(
        /* [in] */ Byte byte);

    CARAPI WriteBuffer(
        /* [in] */ const BufferOf<Byte> & buffer,
        /* [out] */ Int32 * pBytesWritten);

    CARAPI WriteBufferEx(
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length,
        /* [in] */ const BufferOf<Byte> & buffer,
        /* [out] */ Int32 * pBytesWritten);

    CARAPI constructor(
        /* [in] */ const BufferOf<Byte> & buffer);

    CARAPI constructor(
        /* [in] */ const BufferOf<Byte> & buffer,
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length);

private:
    BufferOf<Byte>* m_pBuf;
    Int32 m_pos;
    Int32 m_tail;
};

#endif // __CBYTEARRAYOUTPUTSTREAM_H__
